home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
015a
/
fdate41a.zip
/
HOLIDAYS.BAT
< prev
Wrap
DOS Batch File
|
1992-01-03
|
6KB
|
130 lines
@echo off
CLS
REM If you have any corrections to the algorithms
REM in this batch file, please send them to Steve Ferg.
if not (%1)==() goto nohelp
echo ───────────────────────────────────────────────────────────────────────────────
echo HOW TO USE HOLIDAYS.BAT
echo ───────────────────────────────────────────────────────────────────────────────
ECHO HOLIDAYS without any parameters displays events in current year.
ECHO.
ECHO HOLIDAYS [year] displays events in [year].
ECHO EXAMPLE: HOLIDAYS 1999 displays events in year 1999.
ECHO.
pause
cls
:nohelp
Fdate /Ff /At /Occyy /P"@set year=" >junktemp.bat
if errorlevel 1 echo FDATE ENCOUNTERED AN ERROR
if errorlevel 1 goto endit
call junktemp.bat
del junktemp.bat
REM if user specifies a year as parm1, use it
if not (%1)==() set year=%1
rem --------------------------------------------------------
rem determine if year is a leapyear
rem AND ALSO check for validity of year
rem --------------------------------------------------------
Fdate /Ff /Imm-dd-ccyy /A01-01-%year% /Oly /P"@set LY=">junktemp.bat
if errorlevel 1 echo Parm 1 was not a valid year: %1
call junktemp.bat
del junktemp.bat
if errorlevel 1 goto endit
echo ───────────────────────────────────────────────────────────────────────────────
ECHO EVENTS IN THE FIRST HALF OF %YEAR%
echo ───────────────────────────────────────────────────────────────────────────────
Fdate /Ff /Imm-dd-ccyy /Od1 /a01-01-%year% /P"New Year's Day........................"
Fdate /Fw /D2 /N3 /A01-01-%year% /Imm-dd-ccyy /Od1 /P"Martin Luther King, Jr. Day..........."
Fdate /Ff /Imm-dd-ccyy /Od1 /a02-14-%year% /P"Valentine's day......................."
Fdate /Ff /Imm-dd-ccyy /Od1 /a03-17-%year% /P"St. Patricks's Day...................."
if (%LY%)==(1) Fdate /Ff /Imm-dd-ccyy /Od1 /a02-29-%year% /P"Sadie Hawkins Day....................."
set ly=
set easter=
if (%year%)==(1992) set easter=04-19-%year%
if (%year%)==(1993) set easter=04-11-%year%
if (%year%)==(1994) set easter=04-03-%year%
if (%year%)==(1995) set easter=04-16-%year%
if (%year%)==(1996) set easter=04-07-%year%
if (%year%)==(1997) set easter=03-30-%year%
if (%year%)==(1998) set easter=04-12-%year%
if (%year%)==(1999) set easter=04-04-%year%
if (%year%)==(2000) set easter=04-23-%year%
if (%easter%)==() goto unknown
Fdate /Fsub /Imm-dd-ccyy /N40 /Od1 /a%easter% /P"Mardi Gras (Shrove Tuesday)..........."
Fdate /Fsub /Imm-dd-ccyy /N39 /Od1 /a%easter% /P"Ash Wednesday (Lent begins)..........."
Fdate /Fsub /Imm-dd-ccyy /N7 /Od1 /a%easter% /P"Palm Sunday..........................."
Fdate /Ff /Imm-dd-ccyy /Od1 /a%easter% /P"Easter................................"
set easter=
:unknown
Fdate /Fw /D4 /N4 /A04-01-%year% /Imm-dd-ccyy /Od1 /P"Secretaries Day......................."
Fdate /Ff /Imm-dd-ccyy /Od1 /a05-05-%year% /P"Cinco de Mayo (Mexico)................"
Fdate /Fw /D1 /N2 /A05-01-%year% /Imm-dd-ccyy /Od1 /P"Mother's Day.........................."
Fdate /Fw /D2 /N-1 /A05-24-%year% /Imm-dd-ccyy /Od1 /P"Victoria Day (Canada)................."
Fdate /Ff /Imm-dd-ccyy /Od1 /a05-30-%year% /P"Memorial Day.........................."
echo ───────────────────────────────────────────────────────────────────────────────
echo.
PAUSE
CLS
echo ───────────────────────────────────────────────────────────────────────────────
ECHO EVENTS IN THE SECOND HALF OF %YEAR%
echo ───────────────────────────────────────────────────────────────────────────────
rem ------------ begin bloom's day --------------------------------------
rem Here's another way to show an anniversary that you want to note.
rem Set SD (special date) to the ORIGINAL date of an event whose
rem anniversary you want to note.
rem --------------------------------------------------------
rem June 16, 1904: Bloom's day
SET SD=06-16-1904
Fdate /Ff /Imm-dd-ccyy /A%SD% /Occyy /P"@set SDccyy=">junktemp.bat
call junktemp.bat
del junktemp.bat
Fdate /Ff /Imm-dd-ccyy /A%SD% /Ommdd /P"@set SDmmdd=">junktemp.bat
call junktemp.bat
del junktemp.bat
rem find difference of years
Fdate /F#dif /A%SDccyy% /B%year% /P"@set SD#=">junktemp.bat
call junktemp.bat
del junktemp.bat
Fdate /Ff /Iccyymmdd /A%year%%SDmmdd% /Od1 /P"%SD#%th anniversary of Bloom's day......."
set SD=
set SD#=
set SDmmdd=
set SDccyy=
rem ---------------end bloom's day --------------------------------------
Fdate /Ff /Imm-dd-ccyy /Od1 /a07-01-%year% /P"Canada Day (Canada)..................."
Fdate /Ff /Imm-dd-ccyy /Od1 /a07-04-%year% /P"4th of July..........................."
Fdate /Ff /Imm-dd-ccyy /Od1 /a07-14-%year% /P"Bastille Day (France)................."
Fdate /Fw /D2 /N2 /A10-01-%year% /Imm-dd-ccyy /Od1 /P"Columbus Day (observed)..............."
Fdate /Ff /Imm-dd-ccyy /Od1 /a11-11-%year% /P"Veteran's Day........................."
Fdate /Fw /D5 /N4 /A11-01-%year% /Imm-dd-ccyy /Od1 /P"Thanksgiving Day......................"
rem ----------- begin: Pearl Harbor day -----------------------------
rem Show an anniversary number. (Thanks to L. Schliesser for example)
rem -----------------------------------------------------------------
Fdate /F#dif /A%year% /B1941 /P"@set ann=">junktemp.bat
call junktemp.bat
del junktemp.bat
Fdate /Ff /Imm-dd-ccyy /a12-07-%year% /Od1 /P"Pearl Harbor Day (%ann%th anniversary)..."
rem ----------- end: Pearl Harbor day -----------------------------
Fdate /Ff /Imm-dd-ccyy /Od1 /a12-25-%year% /P"Christmas............................."
Fdate /fadd /Imm-dd-ccyy /Od1 /N1 /a12-31-%year% /P"New Year's Day........................"
echo ───────────────────────────────────────────────────────────────────────────────
echo.
:endit
set year=
set LY=